Skip to content

fix(fold): report the panel the verified pose lights, not the pre-fold one - #5012

Merged
thymikee merged 2 commits into
callstack:mainfrom
imranbarbhuiya:fix/fold-reports-new-panel
Nov 23, 2026
Merged

thymikee merged 2 commits into
callstack:mainfrom
imranbarbhuiya:fix/fold-reports-new-panel

Conversation

@imranbarbhuiya

@imranbarbhuiya imranbarbhuiya commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On the iPhone Duo, fold read the lit panel once, right after the hinge stopped. The guest can switch panel power later, so screen could name the panel lit before the fold.

After a named pose, fold now rereads the panel table for a few seconds until the pose's panel is lit (primary when closed, the other panel otherwise). If it never is, screen is left out. The reads stop at once when the table is unresolved or reports no measured power. Custom keyframe angles keep a single read. Poll reads are bounded by the deadline, so the wait costs about one read. Help and ADR 0025 are updated.

Before / after

iPhone Duo simulator (iOS 27.2), with fold open / fold closed each followed by screenshot:

base a4f2dcad0 (4 open + 4 closed): panel reported 5/8, omitted 3/8; none disagreed with the screenshot
head 157d15ebb (warm, 7 folds):     panel reported 7/7; open 951x669, closed 466x678, all matching the screenshot

The stale read happened under host load and didn't reproduce on an idle Mac. It is covered by pose.test.ts: on a stale first read, base reports LCD 466x678, head reports LCD-1 669x951.

Validation

  • Head 157d15ebb, check:affected --run --head, exactCommit: true. Every gate passes except unit, where upload-http-deadline and committed-source-tree fail the same way on clean main on this macOS host.
  • Run directly: provider integration 317/317, adr-citations 2/2.
  • The timeout ledger covers a named pose whose panel never switches (129 s of 255 s).
  • Unrelated and unchanged: the first fold open after a cold boot sometimes fails with fold-pose-dispatched-unverified on both base (1/4) and head (2/3). The helper waits only 3 s for the first hinge sample.

Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff

…d one

The guest switches panel power after the hinge stop, so the single lit-panel
read after an iPhone Duo fold often named the panel lit before the fold.
Poll the lit panel for up to 5 seconds until it is the panel the verified pose
lights (primary when closed, the other panel otherwise), and omit screen when
it never is. A pose that already lit its panel still settles on one read.
Panels were measured only at the closed, half-open and open poses, so a custom
keyframe angle keeps one panel read. An unresolved panel table or one without
measured panel power ends the panel reads at once, and the time left on the
deadline bounds each read, so the wait costs about one full read. The timeout
ledger now measures a named pose whose panel never switches, and ADR 0025
records the exception to its rejected pose-to-panel map.
@thymikee

Copy link
Copy Markdown
Member

Thanks for the fix. The change at 157d15e looks ready, and no conflicts are known. CI is still running: Integration Tests, Coverage and the Smoke Tests had not finished, and Body rules was cancelled, so those need to finish green and Body rules needs a re-run before merge. Not blocking, and fine to take or leave: the ADR and config comment say each read ends by the deadline, but pose.ts uses a 500ms floor, so a late read can run slightly past it; the fold doc asks for all three poses in both device sets, while the PR body shows open and closed only, so one half-open run and one scoped-set run would help; and the ledger test bounds one maximal read, not the multi-read poll, which a test comment could say. Not verified here: the live simulator runs and the 129s/255s figures, which come from the PR body, and the stale-first-read route, which only the mocked unit test covers.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 23, 2026
@thymikee
thymikee merged commit 722570c into callstack:main Nov 23, 2026
15 of 17 checks passed
@imranbarbhuiya
imranbarbhuiya deleted the fix/fold-reports-new-panel branch November 23, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants